<template>
  <smart-table
    :title="subjectTitle"
    :formList="subjectFormList"
    :selectUrl="subjectSelectUrl"
    :insertUrl="subjectInsertUrl"
    :updateUrl="subjectUpdateUrl"
    :deleteUrl="subjectDeleteUrl"
    :exportExcelUrl="subjectExportUrl"
    :importExcelUrl="subjectImportUrl"
    :tableColumns="subjectTableColumns"
    :formButtonCtl="subjectFormButtonCtl"
    :formRules="subjectFormRules" />
</template>

<script>
export default {
  data() {
    return {
      //主题
      subjectTitle: '科目',
      //表单列表
      subjectFormList: [
        {
          title: '科目名',
          name: 'name',
          type: 'input',
          width: 80,
        },
      ],
      //科目查询路径
      subjectSelectUrl: 'subject/lookSubject',
      //科目新增路径
      subjectInsertUrl: 'subject/insertOneSubject',
      //科目更新路径
      subjectUpdateUrl: 'subject/updateOneSubject',
      //科目删除路径
      subjectDeleteUrl: 'subject/deleteSubjects',
      //导出路径
      subjectExportUrl: '/courseService/subject/export',
      //导入路径
      subjectImportUrl: '/courseService/subject/import',
      //表格列
      subjectTableColumns: [
        {
          title: '科目名',
          name: 'name',
          width: 180,
        },
        {
          title: '创建时间',
          name: 'createTime',
          width: 180,
        },
        {
          title: '修改时间',
          name: 'updateTime',
          width: 180,
        },
      ],
      //表单按钮控制
      subjectFormButtonCtl: {
        detailButton: false,
      },
      //表单校验
      subjectFormRules: {
        name: [
          {
            required: true,
            message: '科目名不得为空!',
            trigger: 'blur',
          },
        ],
      },
    }
  },
}
</script>

<style lang="scss" scoped></style>
